package com.zxy.demo.delay;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zxy.demo.delay.pojo.BaseDelayTask;
import com.zxy.demo.redis.RedisUtil;

@Component
public final class TaskIdGeneratorUtils {
	
	@Autowired
	private RedisUtil redisUtil;
	
	public long generateLongId() {
		String key = "Task:IncrIdKey_"+BaseDelayTask.class.getSimpleName();
		return redisUtil.incr(key, 1);
	}
	
}
